import {
  defineConfig
} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    open: true,
    host: '0.0.0.0',
    hmr: true,
    // https://dev.sprs.agtsci.cn/api/sprs/reviewUser/list
    // https://dev.cim.agtsci.cn/
    proxy: {
      '/api': {
        target: 'https://dev.sprs.agtsci.cn/', //后台地址
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        },
 
      }
    }
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
      "@/api": path.resolve(__dirname, "src/api"),
      "@/assets": path.resolve(__dirname, "src/assets"),
      "@/components": path.resolve(__dirname, "src/components"),
      "@/router": path.resolve(__dirname, "src/router"),
      "@/store": path.resolve(__dirname, "src/store"),
      "@/utils": path.resolve(__dirname, "src/utils"),
    }
  },
})